<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
</head>
<body onbeforeunload="return false;" onunload="return false;" style="width: 100%;height: 100%;">
</body>
<script>
    (function (width, multiple) {
        //rem适配方案
        document.documentElement.style.fontSize = 2 * document.documentElement.clientWidth / width * multiple + 'px';
        window.addEventListener("resize", function () {
            document.documentElement.style.fontSize = 2 * document.documentElement.clientWidth / width * multiple + 'px';
        }, false);
        window.addEventListener("orientationchange", function () {
            document.documentElement.style.fontSize = 2 * document.documentElement.clientWidth / width * multiple + 'px';
        }, false);

        function plusReady() {
            var setLocalItem = function (key, item) {
                plus.storage.setItem(key, JSON.stringify(item));
            }, removeLocalItem = function (key) {
                plus.storage.removeItem(key);
            };
            setLocalItem("toasting", true);
            setLocalItem("waiting", true);
            //预创建一级界面
            var remToPx = function (rem) {
                return Math.floor(rem * document.documentElement.clientWidth / width * multiple) + "px";
            }, webview = {
                "common-ads": {url: "/pages/common/ads/page.html", styles: {}},
                "common-footer": {url: "/pages/common/footer/page.html", styles: {}},
                "home-index": {url: "/pages/home/index/page.html", styles: {top: '0px', bottom: remToPx(0.98)}},
                "my-index": {url: "/pages/my/index/page.html", styles: {top: '0px', bottom: remToPx(0.98)}},
                "policies-index": {url: "/pages/policies/index/page.html", styles: {top: '0px', bottom: remToPx(0.98)}},
                "times-index": {url: "/pages/times/index/page.html", styles: {top: '0px', bottom: remToPx(0.98)}},
                "videos-index": {url: "/pages/videos/index/page.html", styles: {top: '0px', bottom: remToPx(0.98)}}
            };
            plus.webview.open(webview["common-footer"].url, "common-footer", webview["common-footer"].styles);
            plus.webview.open(webview["my-index"].url, "my-index", webview["my-index"].styles);
            plus.webview.open(webview["videos-index"].url, "videos-index", webview["videos-index"].styles);
            plus.webview.open(webview["policies-index"].url, "policies-index", webview["policies-index"].styles);
            plus.webview.open(webview["times-index"].url, "times-index", webview["times-index"].styles);
            plus.webview.open(webview["home-index"].url, "home-index", webview["home-index"].styles);
            plus.webview.open(webview["common-ads"].url, "common-ads", webview["common-ads"].styles);
        }

        //监听原生支持生效
        if (window.plus) {
            plusReady();
        } else {
            document.addEventListener('plusready', plusReady, false);
        }
    })(750, 100);
</script>
</html>